//
//  WKNavigationBar.m
//  WKDemo
//
//  Created by wangzhaohui-Mac on 14-8-1.
//  Copyright (c) 2014年 com.app. All rights reserved.
//

#import "WKNavigationBar.h"

@interface WKNavigationBar ()

@end

@implementation WKNavigationBar

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        [self setupTitleView];
        
    }
        return self;
}

- (UIView *)setupTitleView
{
    UIView *titleView = [[UIView alloc] initWithFrame:CGRectMake(50, 0, 220, 44)];
    
    [self addSubview:titleView];
    self.labelView = titleView;
    
    //精华按钮
    UIButton *newestBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 75, 44)];
    newestBtn.tag = 1;
    [newestBtn setImage:[UIImage imageNamed:@"nav-order-newest"] forState:UIControlStateNormal];
    [newestBtn setImage:[UIImage imageNamed:@"nav-order-newest-click"] forState:UIControlStateSelected];
    [newestBtn setBackgroundImage:[UIImage imageNamed:@"nav-order-bg"] forState:UIControlStateSelected];
    [self.labelView addSubview:newestBtn];

    
    //最新按钮
    UIButton *newBtn = [[UIButton alloc] initWithFrame:CGRectMake(75, 0, 75, 44)];
    newBtn.tag = 2;
    [newBtn setImage:[UIImage imageNamed:@"nav-order-new"] forState:UIControlStateNormal];
    [newBtn setImage:[UIImage imageNamed:@"nav-order-new-click"] forState:UIControlStateSelected];
    [newBtn setBackgroundImage:[UIImage imageNamed:@"nav-order-bg"] forState:UIControlStateSelected];
    [self.labelView addSubview:newBtn];
    
    
    //穿越按钮
    UIButton *randomBtn = [[UIButton alloc] initWithFrame:CGRectMake(150, 0, 75, 44)];
    randomBtn.tag = 3;
    [randomBtn setImage:[UIImage imageNamed:@"nav-order-random"] forState:UIControlStateNormal];
    [randomBtn setImage:[UIImage imageNamed:@"nav-order-random-click"] forState:UIControlStateSelected];
    [randomBtn setBackgroundImage:[UIImage imageNamed:@"nav-order-bg"] forState:UIControlStateSelected];
    [self.labelView addSubview:randomBtn];
    

    return titleView;

}

- (void)layoutSubviews
{
    [super layoutSubviews];

  //    self.labelView.frame = CGRectMake(50, 0, 220, 44);
    
}


@end
